﻿namespace Koroutine.Runtime.Condition
{
    public class ConditionAnd : ICondition
    {
        private ICondition _lhs, _rhs;

        public ConditionAnd(ICondition lhs, ICondition rhs)
        {
            _lhs = lhs;
            _rhs = rhs;
        }
        
        public bool Check()
        {
            return _lhs.Check() && _rhs.Check();
        }

        public void Update()
        {
            _lhs.Update();
            _rhs.Update();
        }
    }
}